<template>
  <el-card class="app-container">
    <c-u-r-d-table :option="option"/>
  </el-card>
</template>

<script>
import { bannerApi } from '@/feature/system/infra/api/bannerApi'
import ColumnType from '@/framework/constant/ColumnType'
import OnlineStatusEnum from '@/framework/constant/OnlineStatusEnum'
import CURDTable from '@/framework/components/table/CURDTable'
import BannerPosEnum from '@/feature/system/enums/BannerPosEnum'

export default {
  components: { CURDTable },
  data() {
    return {
      option: {
        requestApi: bannerApi,
        columns: [{
          label: '名称',
          prop: 'title',
          type: ColumnType.TEXT,
          searchable: true,
          span: 12,
          required: true
        }, {
          label: 'banner位置',
          prop: 'pos',
          type: ColumnType.SELECT,
          searchable: true,
          options: BannerPosEnum,
          span: 12,
          required: true
        }, {
          label: '排序号',
          prop: 'sort',
          type: ColumnType.NUMBER,
          searchable: false,
          renderOptions: { min: 1 },
          span: 12,
          required: true
        }, {
          label: 'banner图片',
          prop: 'imgSrc',
          type: ColumnType.IMAGE,
          span: 24,
          limit: 1,
          required: true
        }, {
          label: '状态',
          prop: 'status',
          type: ColumnType.SELECT,
          options: OnlineStatusEnum,
          hiddenInForm: true,
          searchable: true
        }, {
          label: '链接地址',
          prop: 'link',
          type: ColumnType.TEXT,
          width: '300px',
          span: 24
        }, {
          label: '创建时间',
          prop: 'gmtCreate',
          type: ColumnType.DATETIME,
          hiddenInForm: true
        }, {
          label: '修改时间',
          prop: 'gmtModified',
          type: ColumnType.DATETIME,
          hiddenInForm: true
        }]
      }
    }
  },
  methods: {}
}
</script>

